package com.ccl.iot.device;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.ccl.iot.R;
import com.ccl.iot.views.WaitRegView;

/**
 * @description：意向控制页普通灯的界面
 * @author： HD
 * @time：2017/4/7
 */

public class CommonControlView extends FrameLayout {

    public LinearLayout mCameraLayout;
    public DeviceControlView mDeviceControlView;
    private WaitRegView mWaitRegView;

    public CommonControlView(Context context) {
        this(context, null,0);
    }

    public CommonControlView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public CommonControlView(Context context,  AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        LayoutInflater.from(context).inflate(R.layout.view_common_control, this, true);

        mCameraLayout = (LinearLayout) findViewById(R.id.layout_camera_frame);

        mWaitRegView = (WaitRegView) findViewById(R.id.waitregview_dimmer);

        mDeviceControlView = new DeviceControlView(getContext());

        addView(mDeviceControlView);

        initData();
    }

    private void initData(){
        mDeviceControlView.setWaitRegView(mWaitRegView);
    }

    public void setDevice(IOTDevice device){
        mDeviceControlView.setDevice(device);
    }
}
